



class xio:
    def __init__(me, cancom ):
        me.cancom = cancom
        
        #me.msg={ 0x7A4:[0,0,0,0,0,0,0,0] }
        
    def do(me, channel, value , update=True ):
        xvalue={None:0, True:1, 1:1, 0:0, False:2}
        
        byte=channel//4
        channel%=4
        message=byte//8
        byte%=8
        id=0x7A4+message
        data=8*[0x00]
        data[byte]=xvalue[value]<<channel
        me.cancom.send_msg( data, id )
    
    def ao(me, channel, value  , update=True ):
        pass
        
    def di(me, channel , update=True ):
        return True
        
    def ai(me, channel , update=True ):
        return 0.0

    def update(me):
        pass